/*****************************************************************************
 * $LastChangedDate: 2011-09-25 12:03:59 -0400 (Sun, 25 Sep 2011) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Main sound header file.
 *//*
 * LEGAL:   COPYRIGHT (C) 2009 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#ifndef SOUND_SOUND_HH
#define SOUND_SOUND_HH 1

#define GET_SOUND() (sound::Sound::GetInstance())

//------------------------------------------------------------------------------

// Sound resources can be freed or left allocated.
// Leaving allocated could be safer but memory checkers will complain.
// A reason for these is lack of SDL documentation regarding memory ownershp.
#define SOUND_FREE 1  // generic
#if COMPILE_SDL_MIXER
#define SOUND_FREE_SDL 1
#elif COMPILE_PLIB
#define SOUND_FREE_PLIB 1
#endif

#if VERBOSE || DEBUG
#define SOUND_VERBOSE 1
#endif

// LOG_SOUND_ERRORS logs all sound errors (severe errors will still be shown unconditionally).
#if DEBUG
#define LOG_SOUND_ERRORS 1
#endif

#include "sound/defs.hh"

#if COMPILE_SDL_MIXER
#   include "sound/sound_sdl.hh"
#elif COMPILE_PLIB
#   include "sound/sound_plib.hh"
#else
#   include "sound/sound_nop.hh"
#endif

//------------------------------------------------------------------------------

namespace sound {

#if COMPILE_SDL_MIXER
    typedef SoundSDL  Sound;
#elif COMPILE_PLIB
    typedef SoundPLIB Sound;
#else
    typedef SoundNOP  Sound;
#endif

} // namespace sound

#endif // SOUND_SOUND_HH
